package chap06.task4;

import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.FileInputStream;
import java.io.FileOutputStream;

/**
 * @author Administrator
 * 通过字节缓冲流 把当前目录的1.mp4拷贝到c盘根目录
 *
 */
public class CopMp4 {
    public static void main(String[] args)throws Exception {
        BufferedInputStream f1=new BufferedInputStream(new FileInputStream("1.mp4"));
        BufferedOutputStream f2=new BufferedOutputStream(new FileOutputStream("C:\\1.mp4"));
      byte[] bys= new byte[1024];
      int len=0;
      while ((len=f1.read(bys))!=-1){
          f2.write(bys,0,len);
      }
      f1.close();
      f2.close();
    }
}
